package book.book.controller;

import book.book.bean.Books;
import book.book.bean.Borrowinfo;
import book.book.dao.BooksDao;
import book.book.dao.BooksDaoImpl;
import book.book.dao.BorrowinfoDao;
import book.book.dao.BorrowinfoDaoImpl;

import java.util.List;

public class test {
    public static void main(String[] args) {
        BooksDao booksDao = new BooksDaoImpl();
        //Books books = booksDao.queryBookByName("复活", "列夫·托尔斯泰");
        //        System.out.println(books);
        List<Books> books1 = booksDao.selectallBooks();
        books1.iterator().forEachRemaining(test::prt);
        Books books2 = new Books("611b6121cec048ee814817ecf0e22363","复活","作家出版社","列夫·托尔斯泰","教育类",10);
        int i = booksDao.updateBook(books2);
        System.out.println();
        BorrowinfoDao borrowinfoDao = new BorrowinfoDaoImpl();
        System.out.println(borrowinfoDao.selectBorrwInfoByBookId("611b6121cec048ee814817ecf0e22363"));


    }
    public  static void prt(Books book){
        System.out.println(book.getBookname()+" "+book.getAuthor());

    }
}
